#pragma once

#include "IDigraph.h"
#include "BfsVisitor.h"
#include "DfsVisitor.h"

bool operator<(const Edge &a, const Edge &b);
size_t getGraphAsMatrixByteSize(int vertices);
size_t getGraphAsListByteSize(int edges, int vertices);
std::unique_ptr<IDigraph> makeCompactGraph(const std::vector<Edge> &edges, int vertices_num);
void bfs_component(const std::unique_ptr<IDigraph> &graph, int start_vertex, std::unique_ptr<BfsVisitor> &sample_algorithm, std::vector<bool> &is_used);
void bfs(const std::unique_ptr<IDigraph> &graph, std::unique_ptr<BfsVisitor> &sample_algorithm);
void dfs_component(const std::unique_ptr<IDigraph> &graph, int start_vertex, std::unique_ptr<DfsVisitor> &sample_algorithm, std::vector<bool> &visited_vertices);
void dfs(const std::unique_ptr<IDigraph> &graph, std::unique_ptr<DfsVisitor> &sample_algorithm);
bool topologicalSort(const std::unique_ptr<IDigraph> &graph, std::vector<int> &order);
std::vector<int> solve2SAT(const std::unique_ptr<IDigraph> &graph, int variables);